﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CunguanChuangye.Models;
using Webdiyer.WebControls.Mvc;

namespace CunguanChuangye.Controllers {

    public class PlatController : Controller {

        public ActionResult Index() {
            IList<ArticleModel> atricles = new List<ArticleModel>();
            for (int i = 0; i < 6; i++) {
                atricles.Add(new ArticleModel { Title = "测试标题blabla测试标题blabla", Date = "2012-5-30" });
            }
            PagedList<ArticleModel> pg_atricles = new PagedList<ArticleModel>(atricles, 1, 6, 90);
            ViewBag.Atricles = pg_atricles;
            return View();
        }

        public ActionResult About() {
            return View();
        }

        public ActionResult Product() {
            return View();
        }

        public ActionResult ProductList(int pageindex = 1) {
            IList<ArticleModel> atricles = new List<ArticleModel>();
            for (int i = 0; i < 12; i++) {
                atricles.Add(new ArticleModel { Title = "测试标题blabla测试标题blabla", Date = "2012-5-30" });
            }
            PagedList<ArticleModel> pg_atricles = new PagedList<ArticleModel>(atricles, pageindex, 12, 90);
            return View(pg_atricles);
        }

        public ActionResult Focus() {
            return View();
        }

        public ActionResult FocusList(int pageindex = 1) {
            IList<ArticleModel> atricles = new List<ArticleModel>();
            for (int i = 0; i < 10; i++) {
                atricles.Add(new ArticleModel { Title = "测试标题blabla测试标题blabla", Date = "2012-5-30" });
            }
            PagedList<ArticleModel> pg_atricles = new PagedList<ArticleModel>(atricles, pageindex, 10, 90);
            return View(pg_atricles);
        }

        public ActionResult Connect() {
            return View();
        }
    }
}